


//
//  GradeApplyView.m
//  jiMuOperate
//
//  Created by 胡梅方 on 16/5/6.
//  Copyright © 2016年 jinXinFengLi. All rights reserved.
//

#import "GradeApplyView.h"
#define GraAplyFont 15
@implementation GradeApplyView
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        CGFloat labelX = 15;
        CGFloat labelW = 100;
        CGFloat labelH = 40;

        UILabel *existNutsLab = [ARC createLabelWithFrame:CGRectMake(labelX, 0, labelW, labelH) Font:GraAplyFont Text:@"当前松果数:"];
        self.existNutsLab = existNutsLab;
        [self addSubview:existNutsLab];
        UILabel *existNutsNum = [ARC createLabelWithFrame:CGRectMake(105, 0, labelW, labelH) Font:GraAplyFont Text:@""];
        self.existNutsNum = existNutsNum;
        [self addSubview:existNutsNum];
        
        UILabel *currentLevelLab = [ARC createLabelWithFrame:CGRectMake(labelX, labelH, 100, labelH) Font:GraAplyFont Text:@"对应级别:"];
        self.currentLevelLab = currentLevelLab;
        [self addSubview:currentLevelLab];
        UILabel *curentLevelNum = [ARC createLabelWithFrame:CGRectMake(105, labelH, 100, labelH) Font:GraAplyFont Text:@""];
        self.curentLevelNum = curentLevelNum;
        [self addSubview:curentLevelNum];


        
        UILabel *buyNutLab= [ARC createLabelWithFrame:CGRectMake(labelX, labelH*2, 100, labelH) Font:GraAplyFont Text:@"购买松果:"];
        self.buyNutLab = buyNutLab;
        [self addSubview:buyNutLab];
        
        JMTextField *buyNutNum = [JMTextField createTextFieldWithFrame:frame
                                                                  Font:GraAplyFont-1
                                                           Placeholder:@"请输入购买数量"
                                                       SecureTextEntry:NO
                                                             TextColor:[UIColor redColor]];
        
        buyNutNum.keyboardType =  UIKeyboardTypeDefault;
        buyNutNum.frame =CGRectMake(105, labelH*2+3, 150, labelH-6);
        buyNutNum.borderStyle = UITextBorderStyleRoundedRect;
        buyNutNum.clearsOnBeginEditing=YES;
        self.buyNutNum = buyNutNum;
        [self addSubview:buyNutNum];
        
        UILabel *afbuyNutLab = [ARC createLabelWithFrame:CGRectMake(labelX, labelH*3, 100, labelH) Font:GraAplyFont Text:@"购买后松果数:"];
        self.afbuyNutLab = afbuyNutLab;
        [self addSubview:afbuyNutLab];
        
        UILabel *afbuyNutNum = [ARC createLabelWithFrame:CGRectMake(115, labelH*3, 100, labelH) Font:GraAplyFont Text:@""];
        self.afbuyNutNum = afbuyNutNum;
        [self addSubview:afbuyNutNum];

        UILabel *finalLevelLab = [ARC createLabelWithFrame:CGRectMake(labelX, labelH*4, 100, labelH) Font:GraAplyFont Text:@"最终等级:"];
        self.finalLevelLab = finalLevelLab;
        [self addSubview:finalLevelLab];
        
        UILabel *finalLevelNum = [ARC createLabelWithFrame:CGRectMake(105, labelH*4, 100, labelH) Font:GraAplyFont Text:@""];
        self.finalLevelNum = finalLevelNum;
        [self addSubview:finalLevelNum];
        
        
        
        UILabel *totalPrice = [ARC createLabelWithFrame:CGRectMake(labelX, labelH*5, 100, labelH) Font:GraAplyFont Text:@"总价格:"];
        self.totalPrice = totalPrice;
        [self addSubview:totalPrice];
        UILabel *totalNum = [ARC createLabelWithFrame:CGRectMake(105, labelH*5, 100, labelH) Font:GraAplyFont Text:@""];
        self.totalNum = totalNum;
        [self addSubview:totalNum];
        for (int i=0; i<5; i++) {
            UIImageView *lineImg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 40+40*i, 320, 1)];
            lineImg.image = [UIImage imageNamed:@"halvingline_2"];
            [self addSubview:lineImg];
            lineImg.frame = [ToolViewAndData MyAutoLayout:lineImg];
        }
        
           
        self.existNutsLab.textColor = [UIColor blackColor];
        self.existNutsNum.textColor = [UIColor redColor];
        self.currentLevelLab.textColor = [UIColor blackColor];
        self.curentLevelNum.textColor = [UIColor redColor];
        self.buyNutLab.textColor = [UIColor blackColor];
        self.buyNutNum.textColor = [UIColor redColor];
        
        self.afbuyNutLab.textColor = [UIColor blackColor];
        self.afbuyNutNum.textColor = [UIColor blackColor];
        self.finalLevelLab.textColor = [UIColor blackColor];
        self.finalLevelNum.textColor = [UIColor blackColor];
        self.totalPrice.textColor = [UIColor blackColor];
        self.totalNum.textColor = [UIColor blackColor];

        
        self.existNutsNum.textAlignment = NSTextAlignmentLeft;
        self.existNutsLab.textAlignment = NSTextAlignmentLeft;
        self.currentLevelLab.textAlignment = NSTextAlignmentLeft;
        self.curentLevelNum.textAlignment = NSTextAlignmentLeft;
        self.buyNutNum.textAlignment = NSTextAlignmentLeft;
        self.buyNutLab.textAlignment = NSTextAlignmentLeft;
        self.afbuyNutLab.textAlignment = NSTextAlignmentLeft;
        self.afbuyNutNum.textAlignment = NSTextAlignmentLeft;
        self.finalLevelLab.textAlignment =NSTextAlignmentLeft;
        self.finalLevelNum.textAlignment =NSTextAlignmentLeft;
        self.totalPrice.textAlignment = NSTextAlignmentLeft;
        self.totalNum.textAlignment = NSTextAlignmentLeft;

        self.existNutsLab.frame = [ToolViewAndData MyAutoLayout:self.existNutsLab];
        self.existNutsNum.frame = [ToolViewAndData MyAutoLayout:self.existNutsNum];
        self.currentLevelLab.frame = [ToolViewAndData MyAutoLayout:self.currentLevelLab];
        self.curentLevelNum.frame = [ToolViewAndData MyAutoLayout:self.curentLevelNum];
        self.buyNutLab.frame = [ToolViewAndData MyAutoLayout:self.buyNutLab];
        self.buyNutNum.frame = [ToolViewAndData MyAutoLayout:self.buyNutNum];
        self.afbuyNutLab.frame =[ToolViewAndData MyAutoLayout:self.afbuyNutLab];
        self.afbuyNutNum.frame = [ToolViewAndData MyAutoLayout:self.afbuyNutNum];
        self.finalLevelLab.frame =[ToolViewAndData MyAutoLayout:self.finalLevelLab];
        self.finalLevelNum.frame =[ToolViewAndData MyAutoLayout:self.finalLevelNum];
        
        self.totalPrice.frame =[ToolViewAndData MyAutoLayout:self.totalPrice];
        self.totalNum.frame = [ToolViewAndData MyAutoLayout:self.totalNum];

        
        
        
    }
    return self;
}

@end
